import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexDemo05 {
    public static void main(String[] args) {
        //
        String path1 = "F:\\IdeaProjects\\MyJava230203\\day28\\dir\\movie\\1.txt";
        String path2 = "F:\\IdeaProjects\\MyJava230203\\day28\\dir\\movie\\2.2.txt";
        String path3 = "F:\\IdeaProjects\\MyJava230203\\day28\\dir\\movie\\22.txt";
        String path4 = "F:\\IdeaProjects\\MyJava230203\\22.txt";
        // 通过正则把path1的文件的目录提取出来，文件的名字 后缀名
        Pattern compile = Pattern.compile("(.*)\\\\(.*)\\.(.*)");
        Matcher matcher = compile.matcher(path2);
        if(matcher.find()){
            System.out.println(matcher.group(1));
            System.out.println(matcher.group(2));
            System.out.println(matcher.group(3));
        }
    }
}
